array creation in numpy

38

>>> import numpy as np
>>> a = np.array([2, 3, 4])
>>> a
array([2, 3, 4])
>>> a.dtype
dtype('int64')
>>> b = np.array([1.2, 3.5, 5.1])
>>> b.dtype
dtype('float64')
a = np.array([1, 2, 3, 4, 5, 6])

Comments

Submit
0 Comments